package hjw.com.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>Project:Academic - Order
 *
 * @author IvanWei玮 -- maste
 * @version 1.0
 * @DataTime 2025/2/18 13:15
 * @since 1.8
 */
public class Order {
    private int ordid;
    private List<OrderItem> orderItems;
    private User user;

    private double amount;
    private int payStatus;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date tpay;
    private int shipStatus;
    private String shipno;
    private String ship2name;
    private String ship2phone;
    private String ship2addr;
    private String shipper;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date tship;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date tsign;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date tcreate;

    public Order() {
        this.ordid = 0;

        this.amount = 0.0;
        this.payStatus = 0;
        this.tpay = new Date();
        this.shipStatus = 0;
        this.shipno = "";
        this.ship2name = "";
        this.ship2phone = "";
        this.ship2addr = "";
        this.shipper = "";
        this.tship = new Date();
        this.tsign = new Date();
        this.tcreate = new Date();
        this.orderItems = new ArrayList<>(1);
        this.user = new User();
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<OrderItem> getOrderItems() {
        return orderItems;
    }

    public void setOrderItems(List<OrderItem> orderItems) {
        this.orderItems = orderItems;
    }

    public int getOrdid() {
        return ordid;
    }

    public void setOrdid(int ordid) {
        this.ordid = ordid;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public int getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(int payStatus) {
        this.payStatus = payStatus;
    }

    public Date getTpay() {
        return tpay;
    }

    public void setTpay(Date tpay) {
        this.tpay = tpay;
    }

    public int getShipStatus() {
        return shipStatus;
    }

    public void setShipStatus(int shipStatus) {
        this.shipStatus = shipStatus;
    }

    public String getShipno() {
        return shipno;
    }

    public void setShipno(String shipno) {
        this.shipno = shipno;
    }

    public String getShip2name() {
        return ship2name;
    }

    public void setShip2name(String ship2name) {
        this.ship2name = ship2name;
    }

    public String getShip2phone() {
        return ship2phone;
    }

    public void setShip2phone(String ship2phone) {
        this.ship2phone = ship2phone;
    }

    public String getShip2addr() {
        return ship2addr;
    }

    public void setShip2addr(String ship2addr) {
        this.ship2addr = ship2addr;
    }

    public String getShipper() {
        return shipper;
    }

    public void setShipper(String shipper) {
        this.shipper = shipper;
    }

    public Date getTship() {
        return tship;
    }

    public void setTship(Date tship) {
        this.tship = tship;
    }

    public Date getTsign() {
        return tsign;
    }

    public void setTsign(Date tsign) {
        this.tsign = tsign;
    }

    public Date getTcreate() {
        return tcreate;
    }

    public void setTcreate(Date tcreate) {
        this.tcreate = tcreate;
    }

    @Override
    public String toString() {
        return "Order{" +
                "ordid=" + ordid +
                ", user=" + user +

                ", amount=" + amount +
                ", payStatus=" + payStatus +
                ", tpay=" + tpay +
                ", shipStatus=" + shipStatus +
                ", shipno='" + shipno + '\'' +
                ", ship2name='" + ship2name + '\'' +
                ", ship2phone='" + ship2phone + '\'' +
                ", ship2addr='" + ship2addr + '\'' +
                ", shipper='" + shipper + '\'' +
                ", tship=" + tship +
                ", tsign=" + tsign +
                ", tcreate=" + tcreate +
                ", orderItems=" + orderItems +
                '}';
    }
}
